mod traitArgs;
mod r#trait;
mod largest;
mod traitPair;
mod traitStruct;
mod binary_search;

use std::fs::File;
use std::fs::OpenOptions;
use std::io::prelude::*;
use std::io::BufReader;
use std::{thread, time};
use std::time::Duration;
use rand::Rng;
use crate::binary_search::binary_search_run;

use crate::r#trait::ISummary;
use crate::r#trait::Tweet;


use crate::traitArgs::args;

fn main() {
    println!("################### main ##################");

    let tweet = Tweet {
        username: String::from("horse_ebooks"),
        content: String::from(
            "of course, as you probably already know, people",
        ),
        reply: false,
        retweet: false,
    };

    println!("1 new tweet: {}", tweet.summarize());
    println!("go: {}", tweet.go());

    args();

    println!("binary_search_run start");
    let rs = binary_search_run(vec![1, 4, 7, 10, 16, 19], 19);
    assert_eq!(rs, 5);
    let rs = binary_search_run(vec![1, 4, 7, 10, 16, 19], 2);
    assert_eq!(rs, -1);
    println!("binary_search_run finish: {}", rs);
}
